<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width,minimum-scale=1,maximum-scale=1,user-scalable=no">
	<title>供应商旗舰店资料</title>
	<link rel="stylesheet" type="text/css" href="../css/iconfont.css">
	<link rel="stylesheet" type="text/css" href="../css/supplierShopdata.css">
	<script type="text/javascript" src="../js/rem2.js"></script>
</head>
<body>
	<div class="wrap">
		<!-- 头部 -->
		<div class="header">
			<label class="header_left"><img src="../img/w_nav_back.png"></label>
			<div class="header_title">供应商旗舰店</div>
			<label class="header_right"><img src="../img/icon_search.png"></label>
		</div>
		<!-- 头部 -->
		<!-- 内容 -->
		
		<!-- <div class="content">
			<div class="shopheader">
				<div class="shopPic">
					<img src="../img/90x90.jpg">
				</div>
				<h2 class="shopname">供应商旗舰店</h2>
				<div class="shopNum">
					<span class="shopfans">粉丝:1025</span>
					<span class="shopsell">推销商:2654</span>
				</div>
				<div class="focu_btn">关注</div>
			</div>
			<div class="shopzone">
				<div class="shoplist"><p>商品库</p></div>
				<div class="shopdata"><p>资料</p><span class="underline"></span></div>
			</div>
			<div class="item">
				<div class="intro">
					<p>简介</p>
					<p>介绍说明介绍说明介绍说明介绍说明介绍说明介绍说明</p>
				</div>
				<div class="qualification">
					<p>资质认证</p>
					<p><img src="../img/v.png">通过优呗认证</p>
				</div>
				<div class="margin">
					<p>保证金</p>
					<p><img src="../img/gou.png">已缴纳保证金</p>
				</div>
				<div class="phone">
					<p>客服电话</p>
					<P>18523056484</P>
				</div>
				<div class="QQ">
					<p>客服QQ</p>
					<P>1245886541</P>
				</div>
				<div class="weixin">
					<p>客服微信</p>
					<P>teddfmaji520</P>
				</div>
			</div>
		</div> -->
		
		<!-- 内容 -->
	</div>
</body>
<script type="text/javascript">
	var xhr = new XMLHttpRequest()
	xhr.addEventListener("readystatechange",function(e){
		if(xhr.status==200&xhr.readyState==4){
			var Obj = JSON.parse(e.target.response).supplier
			readData(Obj)
			run()
		}
	})
	xhr.open("GET","https://www.easy-mock.com/mock/5bacade73679ca0f56b03f93/suppliershop");
	xhr.send();
	function readData(res){
		var wrap = document.querySelector(".wrap")
		var obj = res
		var template = function(shopPic,shopName,fans,shopsell,intro,quali,margin,phone,qq,weixin){
			return`
			<div class="shopheader">
				<div class="shopPic">
					<img src=${shopPic}>
				</div>
				<h2 class="shopname">${shopName}</h2>
				<div class="shopNum">
					<span class="shopfans">粉丝:${fans}</span>
					<span class="shopsell">推销商:${shopsell}</span>
				</div>
				<div class="focu_btn">关注</div>
			</div>
			<div class="shopzone">
				<div class="shoplist"><p>商品库</p></div>
				<div class="shopdata"><p>资料</p><span class="underline"></span></div>
			</div>
			<div class="item">
				<div class="intro">
					<p>简介</p>
					<p>${intro}</p>
				</div>
				<div class="qualification">
					<p>资质认证</p>
					<p><img src="../img/v.png">${quali}</p>
				</div>
				<div class="margin">
					<p>保证金</p>
					<p><img src="../img/gou.png">${margin}</p>
				</div>
				<div class="phone">
					<p>客服电话</p>
					<P>${phone}</P>
				</div>
				<div class="QQ">
					<p>客服QQ</p>
					<P>${qq}</P>
				</div>
				<div class="weixin">
					<p>客服微信</p>
					<P>${weixin}</P>
				</div>
			</div>
			`
		}
		obj.forEach(function(el,index){
			var content = document.createElement("div")
			content.classList.add("content")
			content.innerHTML=template(el.shopPic,el.shopName,el.fans,el.shopsell,el.intro,el.quali,el.margin,el.kefuphone,el.kefuQq,el.kefuWeixin)
			wrap.appendChild(content)
		})
	}
</script>
<script type="text/javascript">
	function run(){
		var focu_btn = document.querySelector(".focu_btn");
		var shoplist = document.querySelector(".shoplist");
		shoplist.addEventListener("click",function(){
			location.href="supplierShop.html"
		})
		focu_btn.addEventListener("click",function(){
			focu_btn.innerText="已关注"
		})
	}
	
</script>
</html>